home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Delphi Informant Complete 1995 - 2000
/
Delphi Informant Complete 1995 to 2000.iso
/
Delphi Informant Magazine Complete Works SOURCE CODE 1995.rar
/
1995
/
JUL
/
CJ9507
/
unit1.pas
< prev
Wrap
Pascal/Delphi Source File
|
1995-06-01
|
2KB
|
98 lines
unit Unit1;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, DBTables, DB, DBCtrls, StdCtrls, Mask, Grids, DBGrids,
ExtCtrls;
type
TForm1 = class(TForm)
DBEdit1: TDBEdit;
DBEdit2: TDBEdit;
DBEdit3: TDBEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
DataSource1: TDataSource;
Table1: TTable;
DataSource2: TDataSource;
Table2: TTable;
DataSource3: TDataSource;
Table3: TTable;
DBText1: TDBText;
DBText2: TDBText;
Table1OrderNo: TFloatField;
Table1CustNo: TFloatField;
Table1EmpNo: TIntegerField;
Table1CustName: TStringField;
Table1EmpName: TStringField;
DataSource4: TDataSource;
DataSource5: TDataSource;
Table4: TTable;
Table5: TTable;
Table4CustNo: TFloatField;
Table4Company: TStringField;
Table5EmpNo: TIntegerField;
Table5LastName: TStringField;
DBNavigator1: TDBNavigator;
DBGrid1: TDBGrid;
Button1: TButton;
Table2OrderNo: TFloatField;
Table2ItemNo: TFloatField;
Table2PartNo: TFloatField;
Table2Qty: TIntegerField;
Table2Description: TStringField;
Table3PartNo: TFloatField;
Table3Description: TStringField;
Table3ListPrice: TCurrencyField;
Table2Price: TCurrencyField;
Label4: TLabel;
Table2Total: TCurrencyField;
Label5: TLabel;
procedure Table1CalcFields(DataSet: TDataset);
procedure Button1Click(Sender: TObject);
procedure Table2CalcFields(DataSet: TDataset);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Table1CalcFields(DataSet: TDataset);
begin
{if not (Table1CustNo.AsString = '') then}
if Table4.FindKey([Table1CustNo.value]) then
Table1CustName.value := Table4Company.value;
{if not Table1EmpNo.IsNull then}
if Table5.FindKey([Table1EmpNo.AsString]) then
Table1EmpName.value := Table5LastName.value;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
close;
end;
procedure TForm1.Table2CalcFields(DataSet: TDataset);
begin
if Table3.FindKey([Table2PartNo.value]) then
begin;
Table2Description.value := Table3Description.value;
Table2Price.value := Table3ListPrice.value;
Table2Total.AsFloat := Table2Price.AsFloat * Table2Qty.AsFloat;
end;
end;
end.